package com.social.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.social.pojo.PageBean;
import com.social.pojo.Result;
import com.social.pojo.SysUser;

import javax.servlet.http.HttpSession;

/**
 * @BelongsProject: social
 * @BelongsPackage: com.social.service
 * @Author: zhm
 * @CreateTime: 2022-09-26  20:43
 * @Description: TODO
 * @Version: 1.0
 */
public interface SysUserService extends IService<SysUser> {

    /**
     * 用户注册
     */
    Result register(SysUser sysUser, HttpSession session);

    /**
     * 用户登录
     */
    Result login(SysUser user, HttpSession httpSession);


    /**
     * 发送验证码
     * @param phone
     * @param session
     * @return
     */
    Result sendCode(String phone, HttpSession session);

    /**
     * 根据用户名查询用户
     */
    public SysUser findByUsername(String username);

    /**
     * 根据电话号码查询用户
     */
    SysUser findByPhone(String phone);

    String getUserAuthorityInfo(Long userId);

    Result add(SysUser sysUser);

    Result updateUserPwd(SysUser sysUser);

    Result updateAvatar(SysUser sysUser);

    Result findAll(PageBean pageBean);

    Result checkUserName(SysUser sysUser);

    Result resetPassword(Integer id);

    Result updateStatus(Integer id, String status);

    Result grantRole(Long userId, Long[] roleIds);

    Result getKey();
}
